package com.client.job.core.constant;

/**
 * 任务运行状态
 * @des
 * @author mengxiangzhong
 * @date 2021年9月9日
 *
 */
public enum JobInstanceStatus {
	JOB_RUNNING(0,"运行中"),
	JOB_STOPING(1,"已暂停"),
	JOB_DELETE(2,"删除该应用上该实例"),
	SERVER_RUNNING(0,"服务运行中"),
	SERVER_STOP(1,"服务宕机");


	private Integer status;
	private String msg;
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	private JobInstanceStatus(Integer status, String msg) {
		this.status = status;
		this.msg = msg;
	}
	
	
	public static String getByCode(Integer code) {
		for(JobInstanceStatus js : JobInstanceStatus.values()) {
			if(js.getStatus() == code) {
				return js.getMsg();
			}
		}
		return null;
	}

}
